//
//  KFDPreferentialActivitiesViewModel.m
//  KFD
//
//  Created by JIRENTIANXIANG on 6/30/15.
//  Copyright © 2015 kfd. All rights reserved.
//

#import "KFDPreferentialActivitiesViewModel.h"
#import "KFDClient.h"

@implementation KFDPreferentialActivitiesViewModel

-(void)loadActivitiesUnderwayWithMaxCount:(NSUInteger)maxCount page:(NSUInteger)page
{
    KFDClient* client=[KFDClient sharedClient];
    [client getPreferentialActivitiesWithType:@"1" maxCount:maxCount page:page successHandler:^(NSArray *activities) {
        self.activitiesUnderway=activities;
        [[NSNotificationCenter defaultCenter] postNotificationName:KFDPreferentialActivitiesUnderwayReadyNotification object:nil];
    } failureHandler:^(KFDResponseBody *response) {
        
    }];
}

-(void)loadActivitiesFinishedWithMaxCount:(NSUInteger)maxCount page:(NSUInteger)page
{
    KFDClient* client=[KFDClient sharedClient];
    [client getPreferentialActivitiesWithType:@"2" maxCount:maxCount page:page successHandler:^(NSArray *activities) {
        self.activitiesFinished=activities;
        [[NSNotificationCenter defaultCenter] postNotificationName:KFDPreferentialActivitiesFinishedReadyNotification object:nil];
    } failureHandler:^(KFDResponseBody *response) {
        
    }];
}

@end
